﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Random
{
    public partial class Random : System.Web.UI.Page
    {
        private static System.Random rand = new System.Random();

        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void aspSubmit_Click(object sender, EventArgs e)
        {
            try
            {
                this.aspRes.Text = "Result is : " + (int.Parse(this.aspMin.Text) + rand.Next(int.Parse(this.aspMax.Text))).ToString();
            }
            catch (Exception ex)
            {
                this.aspRes.Text = ex.Message;
            }
        }

        protected void htmlButton_Click(object sender, EventArgs e)
        {
            try
            {
                this.result.InnerText = "Result is : " + (int.Parse(this.minimum.Value) + rand.Next(int.Parse(this.maximum.Value))).ToString();
            }
            catch (Exception ex)
            {
                this.result.InnerText = ex.Message;
            }
        }

    }
}